#include<bits/stdc++.h>
using namespace std;

int arr[40][40];
int main(){
    int n;
    cin>>n;

    //vector<vector<int>> arr(n+1,vector<int>(n+1));
    int y = n/2+1;
    int x = 1;

    for(int K = 1;K<=n*n;K++){
        arr[x][y] = K;
        //1:
        if((x == 1 && y == n) || arr[x-1][y+1] ) x++;
        else if(x == 1){
            x = n;
            y++;
        }else if(y == n){
            x--;
            y = 1;
        }else{
            x--;
            y++;
        }
    }
    for(int i = 1;i<=n;i++){
        for(int j = 1;j<=n;j++){
            cout<<arr[i][j]<<" ";
        }
        cout<<endl;
    }




    return 0;
}